<!DOCTYPE html>
<html lang="zh-CN">
<head><meta name="generator" content="Hexo 3.8.0">

    <!--[if lt IE 9]>
        <style>body {display: none; background: none !important} </style>
        <meta http-equiv="Refresh" Content="0; url=//outdatedbrowser.com/" />
    <![endif]-->

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="author" content="qq">



<meta name="description" content="Java学习 本文档总结自浙江大学翁恺的面向对象程序设计（Java）">
<meta name="keywords" content="Java">
<meta property="og:type" content="article">
<meta property="og:title" content="Java复习">
<meta property="og:url" content="http://huaqq.github.io/2019/04/02/Java/index.html">
<meta property="og:site_name" content="Lionqq&#39;s Blog">
<meta property="og:description" content="Java学习 本文档总结自浙江大学翁恺的面向对象程序设计（Java）">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-04-07T07:04:08.897Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Java复习">
<meta name="twitter:description" content="Java学习 本文档总结自浙江大学翁恺的面向对象程序设计（Java）">

<link rel="apple-touch-icon" href="/apple-touch-icon.png">


    <link rel="alternate" href="/atom.xml" title="Lionqq&#39;s Blog" type="application/atom+xml">



    <link rel="shortcut icon" href="/bitbug_favicon.ico">



    <link href="//cdn.bootcss.com/animate.css/3.5.1/animate.min.css" rel="stylesheet">



    <link href="//cdn.bootcss.com/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet">



    <script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
    <link href="//cdn.bootcss.com/pace/1.0.2/themes/blue/pace-theme-minimal.css" rel="stylesheet">


<link rel="stylesheet" href="/css/style.css">



<link href="//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">


<title>Java复习 | Lionqq&#39;s Blog</title>

<script src="//cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>

<script>
    var yiliaConfig = {
        fancybox: true,
        animate: true,
        isHome: false,
        isPost: true,
        isArchive: false,
        isTag: false,
        isCategory: false,
        fancybox_js: "//cdn.bootcss.com/fancybox/2.1.5/jquery.fancybox.min.js",
        scrollreveal: "//cdn.bootcss.com/scrollReveal.js/3.1.4/scrollreveal.min.js",
        search: true
    }
</script>


    <script>
        yiliaConfig.jquery_ui = [true, "//cdn.bootcss.com/jqueryui/1.10.4/jquery-ui.min.js", "//cdn.bootcss.com/jqueryui/1.10.4/css/jquery-ui.min.css"];
    </script>



    <script> yiliaConfig.rootUrl = "\/";</script>





    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "//hm.baidu.com/hm.js?9403eb8c3e1afbd49d6eafbef0cf66e5";
            var s = document.getElementsByTagName("script")[0]; 
            s.parentNode.insertBefore(hm, s);
        })();
    </script>


</head></html>
<body>
  <div id="container">
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
    <header id="header" class="inner">
        <a href="/" class="profilepic">
            <img src="/img/tx.png" class="animated zoomIn">
        </a>
        <hgroup>
          <h1 class="header-author"><a href="/">qq</a></h1>
        </hgroup>

        
        <p class="header-subtitle">仙人抚我顶，结发受长生</p>
        

        
            <form id="search-form">
            <input type="text" id="local-search-input" name="q" placeholder="search..." class="search form-control" autocomplete="off" autocorrect="off" searchonload="">
            <i class="fa fa-times" onclick="resetSearch()"></i>
            </form>
            <div id="local-search-result"></div>
            <p class="no-result">No results found <i class="fa fa-spinner fa-pulse"></i></p>
        


        
            <div id="switch-btn" class="switch-btn">
                <div class="icon">
                    <div class="icon-ctn">
                        <div class="icon-wrap icon-house" data-idx="0">
                            <div class="birdhouse"></div>
                            <div class="birdhouse_holes"></div>
                        </div>
                        <div class="icon-wrap icon-ribbon hide" data-idx="1">
                            <div class="ribbon"></div>
                        </div>
                        
                        <div class="icon-wrap icon-link hide" data-idx="2">
                            <div class="loopback_l"></div>
                            <div class="loopback_r"></div>
                        </div>
                        
                        
                    </div>
                    
                </div>
                <div class="tips-box hide">
                    <div class="tips-arrow"></div>
                    <ul class="tips-inner">
                        <li>菜单</li>
                        <li>标签</li>
                        
                        <li>友情链接</li>
                        
                        
                    </ul>
                </div>
            </div>
        

        <div id="switch-area" class="switch-area">
            <div class="switch-wrap">
                <section class="switch-part switch-part1">
                    <nav class="header-menu">
                        <ul>
                        
                            <li><a href="/">主页</a></li>
                        
                            <li><a href="/archives/">所有文章</a></li>
                        
                            <li><a href="/tags/">标签云</a></li>
                        
                            <li><a href="/about/">关于我</a></li>
                        
                        </ul>
                    </nav>
                    <nav class="header-nav">
                        <ul class="social">
                            
                                <a class="fa Email" href="/1076817937@qq.com" title="Email"></a>
                            
                                <a class="fa GitHub" href="#" title="GitHub"></a>
                            
                                <a class="fa RSS" href="/atom.xml" title="RSS"></a>
                            
                        </ul>
                    </nav>
                </section>
                
                
                <section class="switch-part switch-part2">
                    <div class="widget tagcloud" id="js-tagcloud">
                        <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/C-C/">C/C++</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Java/">Java</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/JavaScript/">JavaScript</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Spring/">Spring</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Three-js/">Three.js</a></li></ul>
                    </div>
                </section>
                
                
                
                <section class="switch-part switch-part3">
                    <div id="js-friends">
                    
                      <a class="main-nav-link switch-friends-link" href="https://hexo.io">Hexo</a>
                    
                      <a class="main-nav-link switch-friends-link" href="https://pages.github.com/">GitHub</a>
                    
                      <a class="main-nav-link switch-friends-link" href="http://moxfive.xyz/">MOxFIVE</a>
                    
                    </div>
                </section>
                

                
            </div>
        </div>
    </header>                
</div>
    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
      <div class="overlay">
          <div class="slider-trigger"></div>
          <h1 class="header-author js-mobile-header hide"><a href="/" title="回到主页">qq</a></h1>
      </div>
    <div class="intrude-less">
        <header id="header" class="inner">
            <a href="/" class="profilepic">
                <img src="/img/tx.png" class="animated zoomIn">
            </a>
            <hgroup>
              <h1 class="header-author"><a href="/" title="回到主页">qq</a></h1>
            </hgroup>
            
            <p class="header-subtitle">仙人抚我顶，结发受长生</p>
            
            <nav class="header-menu">
                <ul>
                
                    <li><a href="/">主页</a></li>
                
                    <li><a href="/archives/">所有文章</a></li>
                
                    <li><a href="/tags/">标签云</a></li>
                
                    <li><a href="/about/">关于我</a></li>
                
                <div class="clearfix"></div>
                </ul>
            </nav>
            <nav class="header-nav">
                        <ul class="social">
                            
                                <a class="fa Email" target="_blank" href="/1076817937@qq.com" title="Email"></a>
                            
                                <a class="fa GitHub" target="_blank" href="#" title="GitHub"></a>
                            
                                <a class="fa RSS" target="_blank" href="/atom.xml" title="RSS"></a>
                            
                        </ul>
            </nav>
        </header>                
    </div>
    <link class="menu-list" tags="标签" friends="友情链接" about="关于我">
</nav>
      <div class="body-wrap"><article id="post-Java" class="article article-type-post" itemscope="" itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2019/04/02/Java/" class="article-date">
      <time datetime="2019-04-02T11:53:00.000Z" itemprop="datePublished">2019-04-02</time>
</a>


    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      Java复习
    </h1>
  

      </header>
      
      <div class="article-info article-info-post">
        

        
    <div class="article-tag tagcloud">
        <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Java/">Java</a></li></ul>
    </div>

        <div class="clearfix"></div>
      </div>
      
    
    <div class="article-entry" itemprop="articleBody">
      
          
        <h1 id="java学习"><a class="markdownIt-Anchor" href="#java学习"></a> Java学习</h1>
<p>本文档总结自浙江大学翁恺的面向对象程序设计（Java）</p>
<a id="more"></a>
<h3 id="1-数组的使用"><a class="markdownIt-Anchor" href="#1-数组的使用"></a> 1. 数组的使用</h3>
<p>定义数组变量</p>
<p><code>&lt;类型&gt;[] &lt;名字&gt;=new &lt;类型&gt;[元素个数]</code></p>
<p><code>int[] nums=new int[100];</code></p>
<p>数组存在安全隐患。</p>
<p>数组中的元素必须都为同类型；大小一旦确定就不能改变；元素的个数可以是变量。故安全隐患为数组越界的存在。</p>
<p>编译器不检查数组下标（索引），但运行时会报出异常。</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">int</span>[] a=<span class="keyword">new</span> <span class="keyword">int</span>[<span class="number">10</span>];</span><br><span class="line">a[<span class="number">0</span>]=<span class="number">5</span>;</span><br><span class="line"><span class="keyword">int</span>[] b=a;</span><br><span class="line">b[<span class="number">0</span>]=<span class="number">16</span>;</span><br><span class="line">System.out.println(a[<span class="number">0</span>]);<span class="comment">//结果为16</span></span><br><span class="line">						<span class="comment">//因为数组的赋值是给同一个数组增加另一个管理者</span></span><br></pre></td></tr></table></figure>
<ul>
<li>数组变量是数组的管理者而非数组本身</li>
<li>数组必须创建出来然后交给数组变量来管理</li>
<li>数组变量之间的赋值时管理权限的赋予</li>
<li>数组变量之间的比较是判断是否管理同一个数组，尽管内容相同，没有直接赋值也是管理着不同数组</li>
</ul>
<h3 id="2类"><a class="markdownIt-Anchor" href="#2类"></a> 2.类</h3>
<p>对象=属性+服务</p>
<p>封装即数据和对数据的操作放在一起</p>
<p><code>this</code> 表示当前对象本身</p>
<p>类的成员变量属性为<code>private</code>表示这个成员变量只有在类的内部才能被访问到：</p>
<blockquote>
<ol>
<li>成员函数中可以调用</li>
<li>成员变量初始化的时候可以调用</li>
</ol>
</blockquote>
<p><code>static</code> 变量属于类变量，不属于任何一个对象，<code>类名.static 变量</code>是可以访问到的而其他成员变量不能这么访问。<code>static</code> 函数也是如此。静态函数只能调用静态函数，只能访问静态的成员变量。</p>
<p>不定义<code>public</code> 就会默认使用<code>friendly</code> 来修饰，<code>friendly</code> 作用为只要在同一个包内的成员变量就可以访问。</p>
<p>一个.java文件就是一个编译单元。一个编译单元允许定义很多类，但只允许有一个<code>public</code>属性的类,且这个类的名字和编译单元的名字一样。</p>
<ul>
<li>没有<code>public</code>的类只能在它所属的包里起作用</li>
<li>有<code>public</code>的类可以在包外起作用,只需要在需要用到的地方<code>import</code>即可</li>
</ul>
<p>实现一个数字时钟类，了解成员修饰符的使用</p>
<p>clock.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 实现一个时针、分针类</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@author</span> 10768</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">clock</span> </span>&#123;</span><br><span class="line">	<span class="keyword">private</span> <span class="keyword">int</span> value=<span class="number">0</span>;<span class="comment">//当前值</span></span><br><span class="line">	<span class="keyword">private</span> <span class="keyword">int</span> limit=<span class="number">0</span>;<span class="comment">//进制</span></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="title">clock</span><span class="params">(<span class="keyword">int</span> limit)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">this</span>.limit=limit;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">increase</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">this</span>.value++;</span><br><span class="line">		<span class="keyword">if</span>(<span class="keyword">this</span>.value==<span class="keyword">this</span>.limit) &#123;</span><br><span class="line">			<span class="keyword">this</span>.value=<span class="number">0</span>;</span><br><span class="line">		&#125;		</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">show</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		System.out.println(<span class="keyword">this</span>.value);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">int</span> <span class="title">getValue</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">return</span> <span class="keyword">this</span>.value;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">		clock hour=<span class="keyword">new</span> clock(<span class="number">24</span>);</span><br><span class="line">		<span class="keyword">while</span>(<span class="keyword">true</span>) &#123;</span><br><span class="line">			hour.increase();</span><br><span class="line">			hour.show();</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>clocks.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">clocks</span> </span>&#123;</span><br><span class="line">	<span class="keyword">private</span> clock hour=<span class="keyword">new</span> clock(<span class="number">24</span>);</span><br><span class="line">	<span class="keyword">private</span> clock min=<span class="keyword">new</span> clock(<span class="number">60</span>);</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">flow</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">while</span>(<span class="keyword">true</span>) &#123;</span><br><span class="line">			min.increase();</span><br><span class="line">			<span class="keyword">if</span>(min.getValue()==<span class="number">0</span>) &#123;</span><br><span class="line">				hour.increase();</span><br><span class="line">			&#125;</span><br><span class="line">			System.out.printf(<span class="string">"%02d:%02d\n"</span>,hour.getValue(),min.getValue());<span class="comment">//%02d %后面加格式02表示填充2个字符，如果只有一个前面填0</span></span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">		clocks digit=<span class="keyword">new</span> clocks();</span><br><span class="line">		digit.flow();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="3容器的使用"><a class="markdownIt-Anchor" href="#3容器的使用"></a> 3.容器的使用</h3>
<p><code>ArrayList&lt;String&gt; notes = new ArrayList&lt;String&gt;</code></p>
<p>容器类有两个类型：容器（<code>ArrayList</code>不止这种容器）的类型、元素<code>String</code>的类型</p>
<p><code>HashSet</code> 类似于数学上的集合，即使重复添加一个相同的元素，集合中只出现一次</p>
<blockquote>
<p>对于一个对象，直接用print输出往往输出的是一个地址，但是我们可以通过定义一个<code>tostring</code>成员函数来控制输出的内容，也就是将一个对象变成一段字符串类中的</p>
</blockquote>
<p>notebook.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> java.util.ArrayList;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 记事本</span></span><br><span class="line"><span class="comment"> * 使用了容器来实现</span></span><br><span class="line"><span class="comment"> * 包含功能：添加笔记、获得笔记条数、获得某一笔记、删除某一笔记、列出所有笔记</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@author</span> 10768</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">notebook</span> </span>&#123;</span><br><span class="line">	<span class="keyword">private</span> ArrayList&lt;String&gt; note=<span class="keyword">new</span> ArrayList&lt;String&gt;();</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">add</span><span class="params">(String s)</span> </span>&#123;</span><br><span class="line">		note.add(s);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">add</span><span class="params">(String s,<span class="keyword">int</span> index)</span> </span>&#123;</span><br><span class="line">		note.add(index, s);<span class="comment">//在指定位置之前插入 下标不能大于容器的宽度，否则会越界</span></span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">int</span> <span class="title">getSize</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">return</span> note.size();	</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> String <span class="title">getNote</span><span class="params">(<span class="keyword">int</span> index)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">return</span> note.get(index);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">removeNote</span><span class="params">(<span class="keyword">int</span> index)</span> </span>&#123;</span><br><span class="line">		note.remove(index);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="keyword">public</span> String[] list() &#123;</span><br><span class="line">		String[] a=<span class="keyword">new</span> String[note.size()];</span><br><span class="line">		note.toArray(a);<span class="comment">//或者用for遍历容器，逐一赋值</span></span><br><span class="line">		<span class="keyword">return</span> a;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">		notebook nb=<span class="keyword">new</span> notebook();</span><br><span class="line">		nb.add(<span class="string">"wo"</span>);</span><br><span class="line">		System.out.println(nb.getSize());</span><br><span class="line">		nb.add(<span class="string">"shi"</span>);</span><br><span class="line">		nb.add(<span class="string">"ni"</span>);</span><br><span class="line">		nb.add(<span class="string">"bb"</span>, <span class="number">2</span>);</span><br><span class="line">		nb.removeNote(<span class="number">1</span>);</span><br><span class="line">		String[] a=nb.list();</span><br><span class="line">		<span class="keyword">for</span>(String s:a) &#123;</span><br><span class="line">			System.out.println(s);</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="comment">//for-each循环也能用于容器</span></span><br><span class="line">		ArrayList&lt;String&gt; b=<span class="keyword">new</span> ArrayList&lt;String&gt;();</span><br><span class="line">		b.add(<span class="string">"wow"</span>);</span><br><span class="line">		b.add(<span class="string">"lol"</span>);</span><br><span class="line">		<span class="keyword">for</span>(String s:b) &#123;</span><br><span class="line">			System.out.println(s);</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h5 id="hash表"><a class="markdownIt-Anchor" href="#hash表"></a> Hash表</h5>
<p><code>hash</code>表的键值对必须都是对象，而不能是基础类型，比如说不可以是<code>int</code>，但可以是<code>Interger</code></p>
<p>代码复制要尽可能消除，首先不利于代码的维护，其次不利于代码的扩展。从而产生了继承的概念</p>
<p>Coin.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> java.util.Scanner;</span><br><span class="line"><span class="keyword">import</span> java.util.HashMap;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 输入1输出便士</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@author</span> 10768</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Coin</span> </span>&#123;</span><br><span class="line">	<span class="comment">//hash表</span></span><br><span class="line">	<span class="keyword">private</span> HashMap&lt;Integer,String&gt; coinnames=<span class="keyword">new</span> HashMap&lt;Integer,String&gt;();</span><br><span class="line">	<span class="function"><span class="keyword">private</span> <span class="title">Coin</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		coinnames.put(<span class="number">1</span>, <span class="string">"penny"</span>);</span><br><span class="line">		coinnames.put(<span class="number">10</span>, <span class="string">"dime"</span>);</span><br><span class="line">		coinnames.put(<span class="number">25</span>, <span class="string">"quarter"</span>);</span><br><span class="line">		coinnames.put(<span class="number">50</span>, <span class="string">"half-dolar"</span>);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> String <span class="title">getName</span><span class="params">(<span class="keyword">int</span> amount)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">if</span>(coinnames.containsKey(amount)) &#123;</span><br><span class="line">			<span class="keyword">return</span> coinnames.get(amount);</span><br><span class="line">		&#125;<span class="keyword">else</span> &#123;</span><br><span class="line">			<span class="keyword">return</span> <span class="string">"NOT FOUND"</span>;</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">		Scanner in =<span class="keyword">new</span> Scanner(System.in);</span><br><span class="line">		<span class="keyword">int</span> amount=in.nextInt();</span><br><span class="line">		Coin coin=<span class="keyword">new</span> Coin();</span><br><span class="line">		String name=coin.getName(amount);</span><br><span class="line"><span class="comment">//		while(name!=null) &#123;//当输入的数值不在hash表中，退出程序。</span></span><br><span class="line">		System.out.println(name);</span><br><span class="line"><span class="comment">//			amount=in.nextInt();</span></span><br><span class="line"><span class="comment">//			name=coin.getName(amount);</span></span><br><span class="line"><span class="comment">//		&#125;</span></span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="4继承"><a class="markdownIt-Anchor" href="#4继承"></a> 4.继承</h3>
<p>子类<code>extends</code> 父类之后，将得到父类中的方法，子类可以访问父类中不包括<code>private</code>修饰的变量。可以访问<code>protected</code> 修饰的变量，即使父类子类不在同一个包内。</p>
<blockquote>
<p>在子类中不仅要对自己完成初始化，还要对其父类进行初始化</p>
<p><code>super()</code> 调用父类的无参构造函数</p>
<p><code>super(...)</code> 调用父类的对应的有参构造函数</p>
<p>如果父子类中有同名变量，则子类的是子类的，父类的是父类的</p>
<p><code>super.print()</code>子类可以如此调用父类的方法</p>
</blockquote>
<p>父类：Ren.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Ren</span> </span>&#123;</span><br><span class="line">	<span class="keyword">private</span> <span class="keyword">int</span> age;</span><br><span class="line">	<span class="keyword">private</span> String name;<span class="comment">//除非迫不得已，不能把private修改为protected	</span></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="title">Ren</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">super</span>();</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="title">Ren</span><span class="params">(<span class="keyword">int</span> age, String name)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">super</span>();</span><br><span class="line">		<span class="keyword">this</span>.age = age;</span><br><span class="line">		<span class="keyword">this</span>.name = name;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">print</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		System.out.print(age+<span class="string">" "</span>+name+<span class="string">" "</span>);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>两个子类：</p>
<p>Boy.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Boy</span> <span class="keyword">extends</span> <span class="title">Ren</span></span>&#123;</span><br><span class="line">	<span class="keyword">private</span> <span class="keyword">int</span> mon;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="title">Boy</span><span class="params">(<span class="keyword">int</span> age, String name,<span class="keyword">int</span> mon)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">super</span>(age,name);</span><br><span class="line">		<span class="keyword">this</span>.mon=mon;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">print</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		System.out.print(<span class="string">"Boy:"</span>);</span><br><span class="line">		<span class="keyword">super</span>.print();</span><br><span class="line">		System.out.println(mon);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>Girl.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Girl</span> <span class="keyword">extends</span> <span class="title">Ren</span></span>&#123;</span><br><span class="line">	<span class="keyword">private</span> String words;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="title">Girl</span><span class="params">(<span class="keyword">int</span> age, String name,String words)</span> </span>&#123;</span><br><span class="line">		<span class="keyword">super</span>(age,name);</span><br><span class="line">		<span class="keyword">this</span>.words = words;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">print</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		System.out.print(<span class="string">"Girl:"</span>);</span><br><span class="line">		<span class="keyword">super</span>.print();</span><br><span class="line">		System.out.println(words);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>Db.java</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//实现一个存储人的信息的类</span></span><br><span class="line"><span class="keyword">import</span> java.util.ArrayList;</span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">Db</span> </span>&#123;</span><br><span class="line">	<span class="keyword">private</span> ArrayList&lt;Ren&gt; r=<span class="keyword">new</span> ArrayList&lt;Ren&gt;();</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">add</span><span class="params">(Ren ren)</span> </span>&#123;</span><br><span class="line">		r.add(ren);</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">list</span><span class="params">()</span> </span>&#123;</span><br><span class="line">		<span class="keyword">for</span>(Ren a:r) &#123;</span><br><span class="line">			a.print();</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">main</span><span class="params">(String[] args)</span> </span>&#123;</span><br><span class="line">		Db d=<span class="keyword">new</span> Db();</span><br><span class="line">		d.add(<span class="keyword">new</span> Boy(<span class="number">10</span>,<span class="string">"qq"</span>,<span class="number">25</span>));</span><br><span class="line">		d.add(<span class="keyword">new</span> Girl(<span class="number">16</span>,<span class="string">"ww"</span>,<span class="string">"rwqrqer"</span>));</span><br><span class="line">		d.add(<span class="keyword">new</span> Ren());</span><br><span class="line">		d.list();</span><br><span class="line">	&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="5多态变量"><a class="markdownIt-Anchor" href="#5多态变量"></a> 5.多态变量</h3>
<p>这个变量在运行的时候，在具体某一时刻，它所管理的对象的类型是会变化的</p>
<blockquote>
<p>子类的对象可以被当作父类的对象来使用</p>
<ul>
<li>赋值给父类的变量</li>
<li>传递给需要父类对象的函数</li>
<li>放进存放父类对象的容器里</li>
</ul>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Animal a1=<span class="keyword">new</span> Animal();</span><br><span class="line">Animal a2=<span class="keyword">new</span> Dog();</span><br><span class="line">Animal a3=<span class="keyword">new</span> Cat();</span><br></pre></td></tr></table></figure>
<ul>
<li>Java对象变量是多态的，它们能保存不止一种类型的对象</li>
<li>可以保存声明类型的对象，或声明类型的子类的对象</li>
<li>把子类对象赋给父类的变量时，就发生了向上造型</li>
</ul>
<h5 id="造型cast"><a class="markdownIt-Anchor" href="#造型cast"></a> 造型<code>Cast</code></h5>
<p>父类的对象<strong>不能</strong>赋值给子类的变量（让子类变量去管理父类对象）</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">Animal a;</span><br><span class="line">Dog d=<span class="keyword">new</span> Dog();</span><br><span class="line">a=d;<span class="comment">//ok</span></span><br><span class="line">d=a;<span class="comment">//error</span></span><br><span class="line">d=(Dog) a;<span class="comment">//ok,只有当a这个父类变量实际管理的是Car才行</span></span><br></pre></td></tr></table></figure>
<p>不同于强制类型转换（char-&gt;int-&gt;double），对象本身并没有发生变化</p>
<p>向上造型是安全的，把子类对象当作父类对象来用</p>
<h5 id="函数调用的绑定"><a class="markdownIt-Anchor" href="#函数调用的绑定"></a> 函数调用的绑定</h5>
<p>当通过对象变量调用函数的时候，调用哪个函数称为绑定</p>
<p>静态绑定：根据变量的声明类型决定</p>
<p>动态绑定：根据变量的动态类型决定</p>
<p>在成员函数中调用其他成员函数也是通过<code>this</code>这个对象变量来调用的</p>
<p><code>Override</code>覆盖关系，子类和父类中存在名称和参数完全相同的函数</p>
<p>如Db.java中的<code>a.print()</code>会根据a所管理的对象所属的类去调用这一函数</p>
<h3 id="6object类"><a class="markdownIt-Anchor" href="#6object类"></a> 6.Object类</h3>
<p>所有的类都继承自此类，典型的函数有<code>toString(),equals()</code></p>
<p><code>@Override</code>告诉编译器下面这个函数覆盖了基类的函数，其中修饰符、名称、参数表得完全一样，如果有一个不同就会发生错误</p>
<h3 id="7消除代码复制实现封装与可扩展性"><a class="markdownIt-Anchor" href="#7消除代码复制实现封装与可扩展性"></a> 7.消除代码复制，实现封装与可扩展性</h3>
<p>好的代码！=没有错误的代码，类与类之间要耦合性要低，直接体现在这个类不能直接使用另一个类的成员变量</p>
<p>函数里返回字符串可以<code>String ret=&quot;&quot;; return ret+String</code>，<code>String</code>每一次连接都会产生新的<code>String</code>对象，开销大，不适应<code>String</code>修改多的场景。<code>String</code>操作多的场景一般用</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">StringBuffer sb=<span class="keyword">new</span> StringBuffer();</span><br><span class="line">sb.append(<span class="string">""</span>);</span><br><span class="line"><span class="keyword">return</span> sb.toString;</span><br></pre></td></tr></table></figure>
<p>这种形式</p>
<p><code>硬编码</code> 把数据直接写在代码里。一般而言数据和代码最好是分离的，易于维护。可以用容器来实现——<code>Hash</code>表。</p>
<p>用框架+数据来代替硬编码。定义一个Handler来处理命令，用Hash表来保存命令和Handler之间的关系</p>
<h3 id="8抽象"><a class="markdownIt-Anchor" href="#8抽象"></a> 8.抽象</h3>
<p>画一个圆、画一个矩形这些具体的对象都可以，但是画一个形状呢？所有形状是一个抽象类，它有Draw函数也带有<code>abstract</code>修饰，比如<code>public abstract void draw(Graphics g);</code>不能写出<code>{}</code>，因为这表示这是一个具体的函数，在抽象类中它是抽象的。 抽象类无法实例化。</p>
<blockquote>
<p>抽象函数：表达概念无法实现具体代码的函数</p>
<p>抽象类：表达概念无法构造出实体的类</p>
</blockquote>
<p>内部类定义在别的类的内部、函数内部的类；内部类能直接访问外部的资源包括任何私有的成员，外部是函数是，只能访问那个函数里<code>final</code>的变量</p>
<p>匿名类在<code>new</code>对象的时候给出的类的定义形成了匿名类；匿名类可以继承某类，也可以实现某接口；Swing的消息机制广泛使用匿名类</p>
<blockquote>
<p>MVC模式</p>
<p>M=Model，V=View，C=Controler</p>
<p>M：保存和维护数据，提供接口让C修改数据，通知V刷新画面</p>
<p>V：从M获取数据，根据数据刷新画面</p>
<p>C：从用户得到输入，根据输入调整M中的数据</p>
</blockquote>
<p><strong>控制反转</strong> （IoC），获得依赖对象的方式反转了。一个对象用到另一个对象来完成某个任务，那么它们互相依赖。控制正转就是一个对象主动去创建另一个对象使用它，反转则是由<code>Spring</code> 之类的容器来创建所有的对象，当某对象需要另一个对象的时候，容器就替它创建，对象之间只要负责使用就行，容器的这一行为也称作 <strong>依赖注入</strong>（DI）。</p>

      
    </div>
    
  </div>
  
    
    <div class="copyright">
        <p><span>本文标题:</span><a href="/2019/04/02/Java/">Java复习</a></p>
        <p><span>文章作者:</span><a href="/" title="回到主页">qq</a></p>
        <p><span>发布时间:</span>2019-04-02, 19:53:00</p>
        <p><span>最后更新:</span>2019-04-07, 15:04:08</p>
        <p>
            <span>原始链接:</span><a class="post-url" href="/2019/04/02/Java/" title="Java复习">http://huaqq.github.io/2019/04/02/Java/</a>
            <span class="copy-path" data-clipboard-text="原文: http://huaqq.github.io/2019/04/02/Java/　　作者: qq" title="点击复制文章链接"><i class="fa fa-clipboard"></i></span>
            <script> var clipboard = new Clipboard('.copy-path'); </script>
        </p>
        <p>
            <span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" title="CC BY-NC-SA 4.0 International" target="_blank">"署名-非商用-相同方式共享 4.0"</a> 转载请保留原文链接及作者。
        </p>
    </div>



    <nav id="article-nav">
        
            <div id="article-nav-newer" class="article-nav-title">
                <a href="/2019/04/04/初学three-js（一）/">
                    初学three.js（一）
                </a>
            </div>
        
        
            <div id="article-nav-older" class="article-nav-title">
                <a href="/2019/03/04/Spring——Hello/">
                    Spring——Hello
                </a>
            </div>
        
    </nav>

  
</article>

    <div id="toc" class="toc-article">
        <strong class="toc-title">文章目录</strong>
        
            <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#java学习"><span class="toc-number">1.</span> <span class="toc-text"> Java学习</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-数组的使用"><span class="toc-number">1.0.1.</span> <span class="toc-text"> 1. 数组的使用</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2类"><span class="toc-number">1.0.2.</span> <span class="toc-text"> 2.类</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3容器的使用"><span class="toc-number">1.0.3.</span> <span class="toc-text"> 3.容器的使用</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#hash表"><span class="toc-number">1.0.3.0.1.</span> <span class="toc-text"> Hash表</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4继承"><span class="toc-number">1.0.4.</span> <span class="toc-text"> 4.继承</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5多态变量"><span class="toc-number">1.0.5.</span> <span class="toc-text"> 5.多态变量</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#造型cast"><span class="toc-number">1.0.5.0.1.</span> <span class="toc-text"> 造型Cast</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#函数调用的绑定"><span class="toc-number">1.0.5.0.2.</span> <span class="toc-text"> 函数调用的绑定</span></a></li></ol></li></ol><li class="toc-item toc-level-3"><a class="toc-link" href="#6object类"><span class="toc-number">1.0.6.</span> <span class="toc-text"> 6.Object类</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#7消除代码复制实现封装与可扩展性"><span class="toc-number">1.0.7.</span> <span class="toc-text"> 7.消除代码复制，实现封装与可扩展性</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#8抽象"><span class="toc-number">1.0.8.</span> <span class="toc-text"> 8.抽象</span></a></li>
        
    </div>
    <style>
        .left-col .switch-btn,
        .left-col .switch-area {
            display: none;
        }
        .toc-level-3 i,
        .toc-level-3 ol {
            display: none !important;
        }
    </style>

    <input type="button" id="tocButton" value="隐藏目录" title="点击按钮隐藏或者显示文章目录">

    <script>
        yiliaConfig.toc = ["隐藏目录", "显示目录", !!"false"];
    </script>



    
<div class="share">
    
        <div class="bdsharebuttonbox">
            <a href="#" class="fa fa-twitter bds_twi" data-cmd="twi" title="分享到推特"></a>
            <a href="#" class="fa fa-weibo bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
            <a href="#" class="fa fa-qq bds_sqq" data-cmd="sqq" title="分享给 QQ 好友"></a>
            <a href="#" class="fa fa-files-o bds_copy" data-cmd="copy" title="复制网址"></a>
            <a href="#" class="fa fa fa-envelope-o bds_mail" data-cmd="mail" title="通过邮件分享"></a>
            <a href="#" class="fa fa-weixin bds_weixin" data-cmd="weixin" title="生成文章二维码"></a>
            <a href="#" class="fa fa-share-alt bds_more" data-cmd="more"></a>
        </div>
        <script>
            window._bd_share_config={
                "common":{"bdSnsKey":{},"bdText":"Java复习　| Lionqq's Blog　","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
        </script>
    

    
</div>







    




    <div class="scroll" id="post-nav-button">
        
            <a href="/2019/04/04/初学three-js（一）/" title="上一篇: 初学three.js（一）">
                <i class="fa fa-angle-left"></i>
            </a>
        

        <a title="文章列表"><i class="fa fa-bars"></i><i class="fa fa-times"></i></a>

        
            <a href="/2019/03/04/Spring——Hello/" title="下一篇: Spring——Hello">
                <i class="fa fa-angle-right"></i>
            </a>
        
    </div>

    <ul class="post-list"><li class="post-list-item"><a class="post-list-link" href="/2019/04/04/初学three-js（一）/">初学three.js（一）</a></li><li class="post-list-item"><a class="post-list-link" href="/2019/04/02/Java/">Java复习</a></li><li class="post-list-item"><a class="post-list-link" href="/2019/03/04/Spring——Hello/">Spring——Hello</a></li><li class="post-list-item"><a class="post-list-link" href="/2018/11/16/三维网格平面参数化(一)/">三维网格平面参数化(一)</a></li></ul>




    <script>
        
    </script>
</div>
      <footer id="footer">
    <div class="outer">
        <div id="footer-info">
            <div class="footer-left">
                <i class="fa fa-copyright"></i> 
                2016-2019 qq
            </div>
            <div class="footer-right">
                <a href="http://hexo.io/" target="_blank" title="快速、简洁且高效的博客框架">Hexo</a>  Theme <a href="https://github.com/MOxFIVE/hexo-theme-yelee" target="_blank" title="简而不减 Hexo 双栏博客主题  v3.5">Yelee</a> by MOxFIVE <i class="fa fa-heart animated infinite pulse"></i>
            </div>
        </div>
        
            <div class="visit">
                
                    <span id="busuanzi_container_site_pv" style="display:none">
                        <span id="site-visit" title="本站到访数"><i class="fa fa-user" aria-hidden="true"></i><span id="busuanzi_value_site_uv"></span>
                        </span>
                    </span>
                
                
                    <span>| </span>
                
                
                    <span id="busuanzi_container_page_pv" style="display:none">
                        <span id="page-visit" title="本页阅读量"><i class="fa fa-eye animated infinite pulse" aria-hidden="true"></i><span id="busuanzi_value_page_pv"></span>
                        </span>
                    </span>
                
            </div>
        
    </div>
</footer>
    </div>
    
<script data-main="/js/main.js" src="//cdn.bootcss.com/require.js/2.2.0/require.min.js"></script>





<div class="scroll" id="scroll">
    <a href="#" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
    <a href="#comments" onclick="load$hide();" title="查看评论"><i class="fa fa-comments-o"></i></a>
    <a href="#footer" title="转到底部"><i class="fa fa-arrow-down"></i></a>
</div>
<script>
    // Open in New Window
    
        var oOpenInNew = {
            
            
            
            
            
            
             archives: ".archive-article-title", 
             miniArchives: "a.post-list-link", 
            
             friends: "#js-friends a", 
             socail: ".social a" 
        }
        for (var x in oOpenInNew) {
            $(oOpenInNew[x]).attr("target", "_blank");
        }
    
</script>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
  </div>
</body>
</html>